package com.damie.mapper;

import com.damie.domain.WasteRating;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.damie.param.SitePageParam;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Alon
 * @since 2021-01-25
 */
public interface WasteRatingMapper extends BaseMapper<WasteRating> {

    @Select("select t2.rating_id,t2.rating_comment,t2.rating_opened,\n" +
            "t2.rating_picture,t2.rating_score,t2.rating_site_score,\n" +
            "t2.rating_site_comment,t2.rating_order_id,\n" +
            "t2.rating_create_time,t2.rating_update_time,\n" +
            "t2.rating_user_id,t2.result_comment from t_waste_order t1 join \n" +
            "t_waste_rating t2 ON\n" +
            "t1.waste_order_id = t2.rating_order_id\n" +
            "where t1.site_id=#{siteId} ORDER BY rating_order_id DESC\n" +
            "limit #{current},#{size}")
    List<WasteRating> selectSite(String siteId, Integer current,Integer size);
}
